# file = open("demo.txt")
# for line in file:    # 遍历文件对象
#     print(line, end="")
# file.close()


file = open("test.txt")
print("---第一次输出---")
i = 1
for line in file:
    print(line, end="")
    i += 1
    if i == 3:
       break
print("---第二次输出---")
i = 1
for line in file:
    print(line, end="")
    i += 1
    if i == 3:
       break
file.close()
